Compose Compose Message wwwwwwwwwwwww Form1% Cancel_BTN Cancel Details_BTN &Details Attach_BTN Attac&h Address_BTN &Address Send_BTN &Send Message_EDIT Subject_EDIT bcc_EDIT cc_EDIT To_EDIT Subject_LBL Sub&ject: bcc_LBL &bcc: cc_LBL To_LBL Command1_Click MAPIMessage2 MapiRecip MapiFileH RecipClass MAPI_TO MAPI_CC RecipCountI Reserved Subject Main NoteTextT Body MessageType DateReceivedG FlagsA FileName PathNamey Position FileCount= MAPISendMail MapiSession hWndw ignoreY DisplayStatus To_EDIT cc_EDIT Message_EDIT" Subject_EDIT Command2_Click Quit_BTN_Click Compose Send_BTN_Click Save_BTN_Click Attach_BTN_Clickn FileOpen_DLGe Action FilterJ AttachFilename Cancel_BTN_Click AttachPosition AttachmentN iPosition Attach AttachCount Address_BTN_Click nRecips Address MAPIAddress StringToken delim iPos1 iPos2 WordLen AsString bccR* bcc_EDITx ClassType Class AttachF Form_Click FlagZ FileType @ Form_Load SUCCESS_SUCCESS OldCursor MousePointer Details_BTN_Click Rcpnt MapiResolveName Recip MapiDetails MAPI_BCC These global vars are used to store file attachment information between when the user selects the attachmentt info, until the message is sent.. NOTE: only 10 attachment filess may be specified Address_BTN_Click Copy users To, CC and BCC text linesl into recipient descriptor array ReDim R(0 To 1) As MapiRecip R(0).Name = "Administrator"p R(0).RecipClass = MAPI_TOr R(0).Address = "" R(1).Name = "v-petep"I R(1).RecipClass = MAPI_TOr R(1).Address = "" nRecips = 1s Call MAPIAddress to display the address UIs NOTE: We select only the MAPI_TO class addressd data. Get Address For each recipient structure, append thed name into the To_EDIT field in the composem window. Attach_BTN_Click Don't let the user attach more than 10 files, since we only dimensioned enough room for that. No more file attachments allowed in this demo Display a FileOpen dialog to get thet name of the file to attacht NOTE: This has been left out intentionallyn FileOpen_DLG.FileName = "*.*"* FileOpen_DLG.Filter = "*.*"* FileOpen_DLG.Action = 1* Copy the filename retruned from the FileOpene dialog into the global Attachment arrays fors storage until we send the message the user is composing.s AttachPosition(AttachCount) = -1 AttachFilename(AttachCount) = FileOpen_DLG.FileName AttachCount = AttachCount + 1 Message_EDIT.text = Message_EDIT.text + "#"F Cancel_BTN_Click Hide the Compose window Details_BTN_Click Resolve Form_Load Initialize the attachcount global var when the compose window is loaded Send_BTN_Click Check that user entered at least aa subject field No subject Display the hourglass cursor until* the ReadMail call completes Pull out the "to:" field and build up recipient structuresi Pull out the "cc:" field and build up recipient structuresi Pull out the "bcc:" field and build up recipient structuresi Make sure the user entered a recipient name You must enter a recipient to send mail! Allocate enough recipient structurest Set up the "TO:" recipient structures Set up the "TO:" recipient structures Set up the "BCC:" recipient structures* Build up the file descriptors Set the mail message fields Send the mail, then destroy the compose windowi if the send was successfuls Send Mail Restore the original mouse cursor StringToken Returns a string from string position "iPos" upto a delimeter character Find next delimetere